﻿using System;
using Mvc.XForms.UI.Settings;
using System.Linq.Expressions;

namespace Mvc.XForms.UI {
	public class GridHead<T> : IGridHead<T> {
		private readonly IGrid grid;

		public GridHead(IGrid grid) {
			this.grid = grid;
		}

		public GridHeadSortableSettings Sortable(Expression<Func<T, object>> bind) {
			var sortable = new GridHeadSortable<T>(grid, grid.Formatter, bind);
			return sortable.Settings;
		}
	}
}
